import { request } from '@/utils/service'
import type * as Login from './types/login'
import qs from 'qs'
export function sendSMS(data: Login.SendSMSRequestData) {
  return request<Login.SendSMSResponse>({
    url: 'sendSms',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(data)
  })
}
export function loginApi(data: Login.LoginRequestData) {
  return request<Login.LoginResponse>({
    url: 'loginCustomerService',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(data)
  })
}
export function wxlogin(data: Login.BindingRequestData) {
  return request<Login.LoginResponse>({
    url: 'WeChatBindAccount',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(data)
  })
}
export function Logout(data: Login.LogOutRequestData) {
  return request<any>({
    url: 'logout',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(data)
  })
}
